<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8"/>
</head>

<script th:inline="javascript">

    //android终端或者uc浏览器
    var isAndroid = function () {
        return navigator.userAgent.indexOf('Android') > -1 || navigator.userAgent.indexOf('Linux') > -1
    };
    var isIOS = function () {
        return !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
    };

    //通过React Natvie方式
    let timer = setTimeout(() => {
        clearTimeout(timer);
        window.postMessage([[${result}]], '*');
    }, 200);

    //如果安卓通过客户端注入的JS脚本执行
    if (isAndroid()) {
        window.CallbackHandler.postMessage([[${result}]]);
    }
    //如果IOS通过webkit
    if (isIOS()) {
        window.webkit.messageHandlers.CallbackHandler.postMessage(JSON.parse([[${result}]]));
    }

</script>
<body>
</body>

</html>